<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function submitForm() {
            var formObj=document.getElementById("f1");
            formObj.submit();
        }
        function changeClass() {
            let spanObj=document.getElementById("testSpan");
            spanObj.className="s2";
        }
    </script>
    <style>
        .s1{
            background-color: yellow;
            color: red;
        }
        .s2{
            background-color: blue;
            color: yellow;
        }
    </style>
</head>
<body>
<form action="ddd"id="f1">
    用户名：<input type="text" name="userName">
    <input type="submit"value="提交">
</form>
<input type="button"value="提交表单"onclick="submitForm()"><br>
<a href="../homework11_10/work1.html">跳转</a><br>
<input type="button" value="跳转"onclick="location.href='../homework11_10/work2.html'"><br>
<span id="testSpan"class="s1">测试</span>
<input type="button"value="改变样式"onclick="changeClass()">
</body>
</html>